/**
 * PushPaperController.java
 * Version 1.0.0
 * Created on 2018年7月23日
 *
 */
package com.yincheng.oes.business.exam.pushpaper.controller;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;

import com.yincheng.oes.business.exam.pushpaper.service.PushPaperService;
import com.yincheng.oes.business.group.service.GroupService;

/**
 * @author yangsy
 * @version 1.0.0
 * @since
 * 创建时间：2018年7月23日
 * <p>
 * 功能描述：推送试卷控制层
 * <p>
 * 邮箱地址：446948434@qq.com
 */
@Controller
@RequestMapping("/pushpaper")
public class PushPaperController {

    @Autowired
    private PushPaperService pushPaperService;

    @Autowired
    private GroupService groupService;

    /**
     * 推送试卷
     *
     * @param paperId
     */
    @RequestMapping(value = "/pushPaper.json", method = RequestMethod.POST)
    public void pushPaperToStudents(String paperId) {
        pushPaperService.pushPaperToStudent(paperId);
    }

    /**
     * 将试卷推送给班级集合
     *
     * @param paperId
     * @param groupIds
     */
    @RequestMapping(value = "/pushPaperToGroups.json", method = RequestMethod.POST)
    public void pushPaperToGroups(String paperId, String groupIds) {
        groupService.pushPaperToGroups(paperId, groupIds);
    }

    /**
     * 将试卷推送给特定的学生
     *
     * @param paperId
     * @param userIds
     */
    @RequestMapping(value = "/pushPaperToStudents.json", method = RequestMethod.POST)
    public void pushPaperToStudents(String paperId, String userIds) {
        pushPaperService.pushPaperToStudents(paperId, userIds);
    }
}
